var resLoader = require('resLoader')
var UserData = require('UserData')
cc.Class({
    extends: cc.Component,
    properties: {
    },
    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {
        let inner = this.node.getComponent(cc.Sprite)
        let outer = this.node.parent.getComponent(cc.Sprite)

        if(UserData.runtimeState.day){
            resLoader.localImgLoader("SecretraySystem/室内昼" ,inner)
            resLoader.localImgLoader("SecretraySystem/室外昼" ,outer)
            this.node.getChildByName('光').getChildByName('光1').active =true
            this.node.getChildByName('光').getChildByName('光2').active =true
            this.node.getChildByName('光').getChildByName('光3').active =true
            this.node.getChildByName('光').getChildByName('灯').active =false
        }else{
            resLoader.localImgLoader("SecretraySystem/室内夜" ,inner)
            resLoader.localImgLoader("SecretraySystem/室外夜" ,outer)
            this.node.getChildByName('光').getChildByName('光1').active =false
            this.node.getChildByName('光').getChildByName('光2').active =false
            this.node.getChildByName('光').getChildByName('光3').active =false
            this.node.getChildByName('光').getChildByName('灯').active =true
        }

    },

    // update (dt) {},
});
